package com.qzsoft.zhjd.collect.modules.cement.controller;

import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.qzsoft.zhjd.collect.modules.cement.entity.NCementJwDataEntity;
import com.qzsoft.zhjd.collect.modules.cement.service.NCementJwDataService;

/**
 * 水稳拌合站数据采集表_2024-07-09_济微高速版
 *
 * @author sx
 * @email 
 * @date 2024-07-10 14:24:41
 */
@RestController
@RequestMapping("qualitySupervisionControl/nCementJwData")
public class NCementJwDataController {

    @Autowired
    private NCementJwDataService nCementJwDataService;

    /**
     * 列表
     */
    @RequestMapping("/page")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:page")
    public Result page(@RequestParam Map<String, Object> params){
        IPage page = nCementJwDataService.queryPage(params);
        return new Result().ok(page);
    }


    /**
     * 信息
     */
    @RequestMapping("/find/{id}")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:find")
    public Result find(@PathVariable("id") Integer id){
		NCementJwDataEntity nCementJwData = nCementJwDataService.getInfo(id);
        return new Result().ok(nCementJwData);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:save")
    public Result save(@RequestBody NCementJwDataEntity nCementJwData){
		nCementJwDataService.saveData(nCementJwData);
        return new Result().ok("");
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:update")
    public Result update(@RequestBody NCementJwDataEntity nCementJwData){
        nCementJwDataService.updateData(nCementJwData);
        return new Result().ok("");
    }


    /**
     * 删除单个
     */
    @RequestMapping("/delete/{id}")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:delete")
    public Result deleteOne(@PathVariable("id") Integer id){
        nCementJwDataService.deleteOneData(id);
        return new Result().ok("");
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("qualitySupervisionControl:nCementJwData:delete")
    public Result delete(@RequestBody Integer[] ids){
        nCementJwDataService.deleteData(Arrays.asList(ids));
        return new Result().ok("");
    }
}
